package com.sylar.happygps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class TourActivity extends Activity  implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.tour);
		
		Button btn_title_left = (Button) findViewById(R.id.btn_title_left);
		btn_title_left.setVisibility(View.VISIBLE);
		btn_title_left.setText(R.string.app_name);
		btn_title_left.setOnClickListener(this);
		
		Button btn_help = (Button) findViewById(R.id.btn_help);
		btn_help.setText(R.string.app_name);
		btn_help.setOnClickListener(this);
		
		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setVisibility(View.VISIBLE);
		tv_title_name.setText("旅游");
		
		
		
		View tv_fav_tour = findViewById(R.id.tv_fav_tour);
		tv_fav_tour.setOnClickListener(this);
		View tv_jinqu = findViewById(R.id.tv_jinqu);
		tv_jinqu.setOnClickListener(this);
		View tv_addtour = findViewById(R.id.tv_addtour);
		tv_addtour.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_title_left:
			finish();
			break;
		case R.id.tv_addtour:
			toAddTour();
			break;
		case R.id.tv_fav_tour:
			toCollection();
			break;
		case R.id.tv_jinqu:
			toCollection();
			break;
		default:
			break;
		}
	}
	
	private void toAddTour(){
		Intent intent = new Intent(this,AddTourActivity.class);
		startActivity(intent);
	}
	
	//导航收藏
	private void toCollection(){
		Intent intent = new Intent(this,FaviNavActivity.class);
		startActivity(intent);
	}
}
